package paytreasure.vo;

import java.io.Serializable;
import paytreasure.util.ConstantUtil;

/**
 * 返回集合Json工具类
 * @author liujiwei
 *
 */
public class ResultVo implements Serializable{


	/**
	 * 
	 */
	private static final long serialVersionUID = -5457197646886577182L;

	private String resultCode;
	
	private String resultMsg;
	
	private Object resultObj;

	
	public ResultVo() {
		super();
	}

	public ResultVo(String resultCode, String resultMsg) {
		super();
		this.resultCode = resultCode;
		this.resultMsg = resultMsg;
	}
	
	public ResultVo(String resultCode, String resultMsg, Object resultObj) {
		super();
		this.resultCode = resultCode;
		this.resultMsg = resultMsg;
		this.resultObj = resultObj;
	}

	public void isResultSuccess(){
		this.resultCode = ConstantUtil.RESULT_SUCCESS;
		this.resultMsg = "操作成功";
	}
	
	public void isResultSuccess(String resultMsg,Object obj){
		this.resultCode = ConstantUtil.RESULT_SUCCESS;
		if(null != resultMsg){
			this.resultMsg = resultMsg;
		}else{
			this.resultMsg = "操作成功";
		}
		if(obj!=null){
			this.resultObj = obj;
		}else{
			this.resultObj = null;
		}
	}
	
	public void isResultError(){
		this.resultCode = ConstantUtil.RESULT_ERROR;
		this.resultMsg = "操作失败";
	}
	
	public void isResultError(String resultMsg,Object obj){
		this.resultCode = ConstantUtil.RESULT_ERROR;
		if(resultMsg!=null){
			this.resultMsg = resultMsg;
		}else{
			this.resultMsg = "操作失败";
		}
		if(obj!=null){
			this.resultObj = obj;
		}else{
			this.resultObj = null;
		}
	}
	
	public String getResultCode() {
		return resultCode;
	}

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}


	public String getResultMsg() {
		return resultMsg;
	}

	public void setResultMsg(String resultMsg) {
		this.resultMsg = resultMsg;
	}

	public Object getResultObj() {
		return resultObj;
	}

	public void setResultObj(Object resultObj) {
		this.resultObj = resultObj;
	}



}
